import service from '@/utils/request'
import {deleteProject} from "@/api/generator/project";

export const listFieldType = (query) => {
    return service({
        url: '/gen/fieldtype/page',
        method: 'get',
        params: query
    })
}

export const useFieldTypeApi = (id) => {
    return service.get('/gen/fieldtype/' + id)
}

export const useFieldTypeListApi = () => {
    return service.get('/gen/fieldtype/list')
}

export const useFieldTypeSubmitApi = (dataForm) => {
    if (dataForm.id) {
        return service.put('/gen/fieldtype', dataForm)
    } else {
        return service.post('/gen/fieldtype', dataForm)
    }
}

export const deleteFieldType = (ids) => {
    return service({
        url: '/gen/fieldtype',
        method: 'delete',
        data: ids
    })
}